//api接口统一管理
import requests from "./request";

//登录
export const login = (params) =>requests({url:"/reader/login",method:"post",data:params})
//注册
export const register = (params) =>requests({url:"/register",method:"post",data:params})

//reader
//三级联动的接口
//获得全部用户信息
export const getAllReaderInfo = () => requests.get('/reader/getAllReaderInfo')
//办理图书证，根据条件查询办证信息
export const queryReader = (params) =>requests({url:"/reader/queryReader",method:"post",data:params})
//办理图书证
export const applyLibraryCard = (params) =>requests({url:"/reader/addReader",method:"post",data:params})
//修改读书证信息
export const updateLibraryCardInfo = (params) => requests({url:"/reader/updateReader",method:"post",data:params})
//挂失
export const reportLoss = (params) => requests({url:"/reader/reportLoss",method:"post",data:params})
//解除挂失
export const cancelReportLoss = (params) =>requests({url:"/reader/cancelReportLoss",method:"post",data:params})
//注销
export const cancelAccount = (params) =>requests({url:"/reader/cancelAccount",method:"post",data:params})
//补办
export const postRegister = (params) =>requests({url:"/reader/postRegister",method:"post",data:params})

//book
//加书
 export const addBook = (params) =>requests({url:"/book/addBook",method:"post",data:params})
// //查书
 export const queryBook = (params) =>requests({url:"/book/queryBook",method:"post",data:params})
// //更新书籍信息
 export const updateBook = (params) =>requests({url:"/book/updateBook",method:"post",data:params})
// //删除图书
 export const deleteBook = (params) =>requests({url:"/book/deleteBook",method:"post",data:params})

//借书管理
//查询用户已经借的书
export const queryBorrowedInfo = (params) =>requests({url:"/borrow/queryBorrowed",method:"post",data:params})
//借书
export const borrowBook = (params) =>requests({url:"/borrow/borrowBook",method:"post",data:params})
//续借
export const renewBorrow = (params) =>requests({url:"/borrow/renewBorrow",method:"post",data:params})
//还书
export const returnBook = (params) =>requests({url:"/borrow/returnBook",method:"post",data:params})

